﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Alex.Library.Cloud.Libs;

namespace Alex.Library.Cloud.VMWare.V51.VMMParameters
{
    public class VMPowerOpsParameter : IVMMParameter
    {
        public VMPowerOpsParameter()
        {

        }

        public VMPowerOpsParameter(string vmName, string hostName)
        {
            this.VMName = vmName;
            this.HostName = hostName;
        }

        public string VMName { get; set; }
        public string HostName { get; set; }

        public bool IsValid()
        {
            bool isvalid = true;
            StringBuilder sb = new StringBuilder();
            if (String.IsNullOrEmpty(VMName))
            {
                sb.AppendLine("VMName is empty or null.");
                isvalid = false;
            }
            if (String.IsNullOrEmpty(HostName))
            {
                sb.AppendLine("HostName is empty or null.");
                isvalid = false;
            }
            ErrorMessage = sb.ToString();
            return isvalid;
        }

        public string ErrorMessage { get; private set; }
    }
}
